<?php
/**
* openDocument library kit
*
* @link http://webappkit.net
* @package pathnodes
* @subpackage od
* @author J.Ducastel <nospam0@ducastel.name>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

/**
* provides access to openDocument elements when unzipped to a folder
* @uses odContentNode
*/
class odContainer_folder extends folderNode {
/*--------------------------------------------------------------------
CONSTRUCTOR
--------------------------------------------------------------------*/
    /**
    * constructor alias
    * @access public
    * /
    function odContainer_folder($path) {
        $this->__construct($path);
    }/**/
    
    /**
    * "real" constructor
    * @access public
    * /
    function __construct($path) {
        parent::__construct($path);
        $this->getChildren();
    }/**/
/*--------------------------------------------------------------------
PUBLIC STATIC METHODS
--------------------------------------------------------------------*/
    /**
    * @static
    * @param
    * @return bool
    */
    function selfDetector($path) {
        $path=realpath($path);
        if (!is_dir($path))
            return false;
        // checking for required files
        if (!file_exists($path.'/content.xml')
        or !file_exists($path.'/styles.xml')
        or !file_exists($path.'/meta.xml')
        or !file_exists($path.'/settings.xml')
        ) return false;
        // all checks ok
        return true;
    }/**/
/*--------------------------------------------------------------------
PUBLIC INSTANCE METHODS
--------------------------------------------------------------------*/
    /**
    * retrieves content node
    * @access public
    * @return odContentNode
    */
    function & getContent() {
        if (!$this->content) {
            // getting filenode
            $file=&$this->getChild('content.xml');
            // getting domDocument
            $dom=&$file->getDocument();
            // building odContentNode
            $this->content=& new odContentNode($dom);
        }
        return $this->content;
    }/**/
    
    /**
    *
    * @param
    * @access public
    * @return
    * /
    function () {

    }/**/
    
    /**
    *
    * @param
    * @access public
    * @return
    * /
    function () {

    }/**/
/*--------------------------------------------------------------------
VARS / MEMBERS
--------------------------------------------------------------------*/
    /**
    * @var odContentNode
    */
    var $content;
    
/*--------------------------------------------------------------------
PRIVATE / PROTECTED METHODS
--------------------------------------------------------------------*/
    /**
    * 
    * @param
    * @access protected
    * @return 
    * /
    function () {
        
    }/**/
}
?>